// const baseURL = "https://yizunianbao.cn/ruoyi-admin";
// const baseURL = "http://app.dabinzuf.top:18080";
 
<<<<<<< Updated upstream
 // const baseURL = "http://192.168.1.2:18080";
 // const baseURL = "http://192.168.2.15:18080";   
 const baseURL = "https://app.dabinzuf.top";
// const baseURL = "http://192.168.2.9:18080";
=======
//  const baseURL = "http://192.168.1.3:18080";
 // const baseURL = "http://192.168.2.4:18080";
// const baseURL = "http://app.dabinzuf.top:18080";
 const baseURL = "http://192.168.2.15:18080";
>>>>>>> Stashed changes
 
export  {
	baseURL
}
export default function request(url, method, data) {
	// var loadding = uni.showLoading({
	// 	title:'加载中',
	// 	 mask:true     
	// })
	return new Promise((resolve, reject) => {
		uni.request({
			url: baseURL + url,
			header: {
				"Authorization": "Bearer " + uni.getStorageSync("token")
			},
			method: method,
			data: data,
			timeout: 300000,
			success(res) {
	 
				if (res.data.code == 401) return uni.redirectTo({
					url: '/pages/landlord/login',
					success() {
						uni.showToast({
							title: '登录身份过期 请重新登录',
							icon: 'none'
						})
							// uni.hideLoading(loadding)
					}
				})
				// uni.hideLoading(loadding)
				resolve(res)
			},
			fail(err) {
			 
				uni.showToast({
					title: '连接服务器异常 请重试',
					icon: 'error'
				})
				// uni.hideLoading(loadding)
				reject(err)
			}
		})
	})
}